﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlindData
{
	public static class PositiveGenerator
	{
		/// <summary>
		/// Returns a nonnegative random int.
		/// </summary>
		/// <returns></returns>
		public static int Positive(this INext<int> next)
		{
			if (next == null)
			{
				throw new ArgumentNullException("next");
			}
			return next.Between(0, int.MaxValue);
		}

		/// <summary>
		/// Returns a nonnegative random long.
		/// </summary>
		/// <returns></returns>
		public static long Positive(this INext<long> next)
		{
			if (next == null)
			{
				throw new ArgumentNullException("next");
			}
			return next.Between(0, long.MaxValue);
		}

		/// <summary>
		/// Returns a nonnegative random double.
		/// </summary>
		/// <returns></returns>
		public static double Positive(this INext<double> next)
		{
			if (next == null)
			{
				throw new ArgumentNullException("next");
			}
			return next.Between(0, double.MaxValue);
		}

		/// <summary>
		/// Returns a nonnegative random float.
		/// </summary>
		/// <returns></returns>
		public static float Positive(this INext<float> next)
		{
			if (next == null)
			{
				throw new ArgumentNullException("next");
			}
			return next.Between(0, float.MaxValue);
		}

		/// <summary>
		/// Returns a nonnegative random decimal.
		/// </summary>
		/// <returns></returns>
		public static decimal Positive(this INext<decimal> next)
		{
			if (next == null)
			{
				throw new ArgumentNullException("next");
			}
			return next.Between(0, decimal.MaxValue);
		}
	}
}
